{{ define "main" }}
<div class="top">
  <header class="header__wrapper bgcolor__header">
    <div class="divider">
      <div class="lmr">
        {{ partial "header/taxo-header.html" . }}
      </div>
    </div>
  </header>

  <div class="header__wrapper bgcolor__breadcrumb">
    <div class="divider">
      <div class="lmr flexbox jc-center flex-wrap tag__wrapper">
        {{ range $index, $element := .Site.Taxonomies.tags }}
          {{ if $index }}
            <a href="{{ $element.Page.RelPermalink }}" class="tag">
              <span class="tag__text">
                {{ $element.Page.Title }}
              </span>
              <span class="tag__num" dir="auto">
                {{ printf "%#v" (len $element) }}
              </span>
            </a>
          {{ end }}
        {{ end }}
      </div>
    </div>
  </div>
</div>

<div class="mid blog__bg">
  <main class="main blog__bg">
    <div class="sv" data-view="full">
      <div class="blog">
        {{ range .RegularPages }}
          {{ .Render "summary" }}
        {{ end }}
        {{ partial "main/component/pagination.html" . }}
      </div>
    </div>

  </main>
</div>

<script>
  var singleViewElem = document.querySelectorAll('.sv');

  enquire.register("screen and (max-width:1280px)", {
    match: function () {
      singleViewElem.forEach(function (elem) {
        elem.setAttribute('data-view', 'full');
      });
    },
    unmatch: function () {
      singleViewElem.forEach(function (elem) {
        elem.setAttribute('data-view', 'full');
      });
    },
  }).register("screen and (max-width:769px)", {
    match: function () {
      singleViewElem.forEach(function (elem) {
        elem.setAttribute('data-view', 'mobile');
      });
    },
    unmatch: function () {
      singleViewElem.forEach(function (elem) {
        elem.setAttribute('data-view', 'full');
      });
    },
  });
</script>
{{ end }}